3.776 \(\int \frac {\csc (c+d x) \sec ^2(c+d x)}{a+a \sin (c+d x)} \, dx\)

Optimal. Leaf size=79 \[ -\frac {\tan ^3(c+d x)}{3 a d}-\frac {\tan (c+d x)}{a d}+\frac {\sec ^3(c+d x)}{3 a d}+\frac {\sec (c+d x)}{a d}-\frac {\tanh ^{-1}(\cos (c+d x))}{a d} \]

[Out]

-arctanh(cos(d*x+c))/a/d+sec(d*x+c)/a/d+1/3*sec(d*x+c)^3/a/d-tan(d*x+c)/a/d-1/3*tan(d*x+c)^3/a/d

________________________________________________________________________________________

Rubi [A]  time = 0.12, antiderivative size = 79, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {2839, 2622, 302, 207, 3767} \[ -\frac {\tan ^3(c+d x)}{3 a d}-\frac {\tan (c+d x)}{a d}+\frac {\sec ^3(c+d x)}{3 a d}+\frac {\sec (c+d x)}{a d}-\frac {\tanh ^{-1}(\cos (c+d x))}{a d} \]

Antiderivative was successfully verified.

[In]

Int[(Csc[c + d*x]*Sec[c + d*x]^2)/(a + a*Sin[c + d*x]),x]

[Out]

-(ArcTanh[Cos[c + d*x]]/(a*d)) + Sec[c + d*x]/(a*d) + Sec[c + d*x]^3/(3*a*d) - Tan[c + d*x]/(a*d) - Tan[c + d*
x]^3/(3*a*d)

Rule 207

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTanh[(Rt[b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rule 302

Int[(x_)^(m_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Int[PolynomialDivide[x^m, a + b*x^n, x], x] /; FreeQ[{a,
b}, x] && IGtQ[m, 0] && IGtQ[n, 0] && GtQ[m, 2*n - 1]

Rule 2622

Int[csc[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Dist[1/(f*a^n), Subst[Int
[x^(m + n - 1)/(-1 + x^2/a^2)^((n + 1)/2), x], x, a*Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n
 + 1)/2] &&  !(IntegerQ[(m + 1)/2] && LtQ[0, m, n])

Rule 2839

Int[((cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.))/((a_) + (b_.)*sin[(e_.) + (f_
.)*(x_)]), x_Symbol] :> Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^n, x], x] - Dist[g^2/(b*d),
Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2
 - b^2, 0]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rubi steps

\begin {align*} \int \frac {\csc (c+d x) \sec ^2(c+d x)}{a+a \sin (c+d x)} \, dx &=-\frac {\int \sec ^4(c+d x) \, dx}{a}+\frac {\int \csc (c+d x) \sec ^4(c+d x) \, dx}{a}\\ &=\frac {\operatorname {Subst}\left (\int \frac {x^4}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{a d}+\frac {\operatorname {Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (c+d x)\right )}{a d}\\ &=-\frac {\tan (c+d x)}{a d}-\frac {\tan ^3(c+d x)}{3 a d}+\frac {\operatorname {Subst}\left (\int \left (1+x^2+\frac {1}{-1+x^2}\right ) \, dx,x,\sec (c+d x)\right )}{a d}\\ &=\frac {\sec (c+d x)}{a d}+\frac {\sec ^3(c+d x)}{3 a d}-\frac {\tan (c+d x)}{a d}-\frac {\tan ^3(c+d x)}{3 a d}+\frac {\operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sec (c+d x)\right )}{a d}\\ &=-\frac {\tanh ^{-1}(\cos (c+d x))}{a d}+\frac {\sec (c+d x)}{a d}+\frac {\sec ^3(c+d x)}{3 a d}-\frac {\tan (c+d x)}{a d}-\frac {\tan ^3(c+d x)}{3 a d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.61, size = 149, normalized size = 1.89 \[ \frac {6 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-6 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+\sin \left (\frac {1}{2} (c+d x)\right ) \left (-\frac {11}{\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )}-\frac {2}{\left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )^3}+\frac {3}{\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )}\right )+\frac {1}{\left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )^2}}{6 a d} \]

Antiderivative was successfully verified.

[In]

Integrate[(Csc[c + d*x]*Sec[c + d*x]^2)/(a + a*Sin[c + d*x]),x]

[Out]

(-6*Log[Cos[(c + d*x)/2]] + 6*Log[Sin[(c + d*x)/2]] + (Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^(-2) + Sin[(c + d*
x)/2]*(3/(Cos[(c + d*x)/2] - Sin[(c + d*x)/2]) - 2/(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^3 - 11/(Cos[(c + d*x)
/2] + Sin[(c + d*x)/2])))/(6*a*d)

________________________________________________________________________________________

fricas [A]  time = 0.48, size = 115, normalized size = 1.46 \[ \frac {4 \, \cos \left (d x + c\right )^{2} - 3 \, {\left (\cos \left (d x + c\right ) \sin \left (d x + c\right ) + \cos \left (d x + c\right )\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 3 \, {\left (\cos \left (d x + c\right ) \sin \left (d x + c\right ) + \cos \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 2 \, \sin \left (d x + c\right ) + 4}{6 \, {\left (a d \cos \left (d x + c\right ) \sin \left (d x + c\right ) + a d \cos \left (d x + c\right )\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*sec(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/6*(4*cos(d*x + c)^2 - 3*(cos(d*x + c)*sin(d*x + c) + cos(d*x + c))*log(1/2*cos(d*x + c) + 1/2) + 3*(cos(d*x
+ c)*sin(d*x + c) + cos(d*x + c))*log(-1/2*cos(d*x + c) + 1/2) + 2*sin(d*x + c) + 4)/(a*d*cos(d*x + c)*sin(d*x
 + c) + a*d*cos(d*x + c))

________________________________________________________________________________________

giac [A]  time = 0.18, size = 83, normalized size = 1.05 \[ \frac {\frac {6 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a} - \frac {3}{a {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}} + \frac {15 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 24 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 13}{a {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}^{3}}}{6 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*sec(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

1/6*(6*log(abs(tan(1/2*d*x + 1/2*c)))/a - 3/(a*(tan(1/2*d*x + 1/2*c) - 1)) + (15*tan(1/2*d*x + 1/2*c)^2 + 24*t
an(1/2*d*x + 1/2*c) + 13)/(a*(tan(1/2*d*x + 1/2*c) + 1)^3))/d

________________________________________________________________________________________

maple [A]  time = 0.42, size = 103, normalized size = 1.30 \[ -\frac {1}{2 a d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}+\frac {2}{3 a d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{3}}-\frac {1}{a d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {5}{2 a d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(d*x+c)*sec(d*x+c)^2/(a+a*sin(d*x+c)),x)

[Out]

-1/2/a/d/(tan(1/2*d*x+1/2*c)-1)+1/a/d*ln(tan(1/2*d*x+1/2*c))+2/3/a/d/(tan(1/2*d*x+1/2*c)+1)^3-1/a/d/(tan(1/2*d
*x+1/2*c)+1)^2+5/2/a/d/(tan(1/2*d*x+1/2*c)+1)

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 136, normalized size = 1.72 \[ \frac {\frac {2 \, {\left (\frac {5 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {3 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + 4\right )}}{a + \frac {2 \, a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {2 \, a \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac {a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}} + \frac {3 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a}}{3 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*sec(d*x+c)^2/(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/3*(2*(5*sin(d*x + c)/(cos(d*x + c) + 1) - 3*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 + 4)/(a + 2*a*sin(d*x + c)/(
cos(d*x + c) + 1) - 2*a*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 - a*sin(d*x + c)^4/(cos(d*x + c) + 1)^4) + 3*log(s
in(d*x + c)/(cos(d*x + c) + 1))/a)/d

________________________________________________________________________________________

mupad [B]  time = 9.90, size = 92, normalized size = 1.16 \[ \frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a\,d}+\frac {-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\frac {10\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}+\frac {8}{3}}{d\,\left (-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(c + d*x)^2*sin(c + d*x)*(a + a*sin(c + d*x))),x)

[Out]

log(tan(c/2 + (d*x)/2))/(a*d) + ((10*tan(c/2 + (d*x)/2))/3 - 2*tan(c/2 + (d*x)/2)^3 + 8/3)/(d*(a + 2*a*tan(c/2
 + (d*x)/2) - 2*a*tan(c/2 + (d*x)/2)^3 - a*tan(c/2 + (d*x)/2)^4))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \frac {\int \frac {\csc {\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*sec(d*x+c)**2/(a+a*sin(d*x+c)),x)

[Out]

Integral(csc(c + d*x)*sec(c + d*x)**2/(sin(c + d*x) + 1), x)/a

________________________________________________________________________________________